Skip to content

Run Map: watch for the sign-in from the user's own registry view - #1631

Merged
Frotty merged 2 commits into
masterfrom
battlenet-signin-watcher
Nov 18, 2026
Merged

Frotty merged 2 commits into
masterfrom
battlenet-signin-watcher

Conversation

@Frotty

@Frotty Frotty commented Nov 17, 2026

Copy link
Copy Markdown
Member

Problem

After a renewal, Run Map holds the Battle.net sign-in lock until the launched client replaces EDITOR_TOKEN, which it does as it signs in. It watched for that by reading the token through reg.exe in Wurst's own registry view.

Inside a packaged (MSIX) app whose private registry copy already held an EDITOR_TOKEN, that read never changes. The game is started in the user's own view (#1629), so its new token never shows in Wurst's copy. The lock then stayed held for the full 120 s after a successful sign-in, and every other Run Map or grill run launch waited.

Change

  • battlenet-signin.ps1 (new resource) runs outside Wurst's view through OutsideStart, right after the renewal and before the game starts. It notes the renewed token, prints ready, then prints signed-in once the token changes, or timeout. It never prints a token.
  • Renewal now takes a sign-in check and a close action. releaseWhenSignedIn polls the watcher, and closing the renewal stops the watcher and removes its output file.
  • If the watcher cannot start or does not report ready within 15 s, Run Map reads the token from its own view as before.
  • This is the same change as grill run: renew the Battle.net sign-in and start the game in the user's own registry view WurstSetup#91 for grill run. The script is byte-identical.

Validation

  • ./gradlew compileJava test --tests '*BattleNet*' --tests '*OutsideStart*' passes: BattleNetSignInTest 18, OutsideStartTest 3, BattleNetLaunchWindowsTest 1. New tests cover:
    • the lock released, and the watcher stopped, once the client has signed in;
    • the lock released when the sign-in can no longer be watched;
    • a watcher that ended without a sign-in;
    • the real watcher script against a temporary registry key: no report while the token is unchanged, then signed-in once it is replaced.
  • Not done: a live Run Map from VS Code.

After a renewal, Run Map held the Battle.net lock until it saw the launched
client replace EDITOR_TOKEN, reading the token through reg.exe in Wurst's own
registry view. Inside a packaged app whose private copy already held an
EDITOR_TOKEN, that read never changed, so the lock stayed held for the full
120 s and every other launch waited. A small watcher script now starts outside
Wurst's view right after the renewal, notes the renewed token before the game
starts, and reports once the client replaces it. If it cannot start, Run Map
reads the token from its own view as before. grill run does the same.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T09:25:26.395052Z c9b6445 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f64d5be729

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

If the sign-in watcher could not start and Wurst could not read the renewed
EDITOR_TOKEN, the fallback check reported a sign-in at once, so the lock was
released as the game started. Another renewal could then replace the token
before that client read it. An unknown token now holds the lock until the
timeout, as it did before the watcher.
@Frotty

Frotty commented Nov 18, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: c9b6445e53

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Frotty
Frotty merged commit 409b75e into master Nov 18, 2026
2 checks passed
Frotty added a commit to wurstscript/WurstSetup that referenced this pull request Nov 18, 2026
…read (#92)

If the sign-in watcher could not start and grill's read of the renewed
EDITOR_TOKEN failed, the fallback check took the next successful read for a
sign-in and released the lock, so another renewal could replace the token
before this client read it. An unknown token now holds the lock until the
timeout. The same fix as Run Map's in wurstscript/WurstScript#1631.
@Frotty
Frotty deleted the battlenet-signin-watcher branch November 18, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant